package JUnitTest;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.Test;

import core.dto.Database;
import core.dto.OperatorDTO;
import exceptions.UserNotFoundException;

public class testDatabase {

	private Database db;
	private OperatorDTO user1;
	
	@org.junit.Before
	public void Before(){
		user1 = new OperatorDTO();
		user1.setCpr("2806934444");
		user1.setOprId(33);
		user1.setOprNavn("Per Larsen");
		user1.setPassword("1234");
		
		db = new Database();
		
		db.add(user1);
	}

	@Test
	public void testGetUser() throws UserNotFoundException{
			assertEquals(user1, db.getUser(33));
	}
	
	@Test
	public void testGetUserList(){
		ArrayList<OperatorDTO> userList1 = new ArrayList<OperatorDTO>(); 
		userList1.add(user1);
		
		assertEquals(userList1, db.getUserList());
	}
	
	public void testAdd(){
		
	}
	
	public void testRemove(){
		
	}
}
